package org.summer.lawyer.controller.wx;

import cn.dev33.satoken.annotation.SaIgnore;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.summer.common.mybatis.core.page.PageQuery;
import org.summer.common.mybatis.core.page.TableDataInfo;
import org.summer.lawyer.constant.BannerTypeConstants;
import org.summer.lawyer.domain.vo.banner.BannerVo;
import org.summer.lawyer.service.IBannerService;

/**
 *
 */
@Tag(name = "微信小程序Banner接口", description = "微信小程序Banner接口")
@RequiredArgsConstructor
@RestController
@RequestMapping("/wx/banner")
public class WxBannerController {

    private final IBannerService bannerService;

    @SaIgnore
    @Operation(description = "查询Banner列表")
    @GetMapping("/list")
    public TableDataInfo<BannerVo> list(){
        BannerVo vo = new BannerVo();
        vo.setBannerType(BannerTypeConstants.HOME);
        PageQuery pageQuery = new PageQuery();
        pageQuery.setPageSize(PageQuery.DEFAULT_PAGE_SIZE);
        return bannerService.selectPage(vo, pageQuery);
    }
}
